The present invention relates to an image processing apparatus and image processing method, and a storage medium and, for example, to an image processing apparatus and image processing method, which locate an object, which is being tracked by the photographer, at the center of the frame, and a storage medium.
As moving image input apparatuses (imaging apparatuses), video cameras have prevailed. The most fundamental function of the video camera is to record an input image on a recording medium such as a tape or the like, but the input image may often be different from that the photographer intended.
In order to prevent this as much as possible, various functions that help the photographer have been proposed. As one of such functions, a camera shake correction function is known. The camera shake correction function optically or electrically corrects vibration produced upon photographing when the photographer holds the video camera by the hand.
However, the conventional camera shake correction function can hardly allow the photographer to track an object while locating the object at a specific position within the image frame when the photographer follows the moving object via the video camera. This problem will be explained below with reference to the accompanying drawings.
FIGS. 3A to 3F show an example of the problem to be solved by the present invention. Referring to FIGS. 3A to 3F, reference symbol i denotes a frame image obtained at a predetermined time interval. The following explanation will be given with reference six frames images i=1 to 6.
A video 3a displayed at nearly the center in the frame is an object, which is being tracked by the photographer, and exemplifies a person who is running to the right in the frame. A video 3b displayed below the video 3a represents a background portion, which is still in position unless the video camera is moved. In such situation, the photographer is photographing while moving the video camera in correspondence with the movement of the object, so as to locate the object at nearly the frame center.
However, since there is no means for synchronizing the movements of the object and video camera, a skilled technique is required for the photographer to locate the object at a predetermined position within the frame. For this reason, it is very hard for the photographer who is not skilled in photographing to always locate the object at nearly the center of the frame.
In the example shown in FIGS. 3A to 3F, the position of the object in the second frame (i=2) is in front of that in the first frame (i=1), and the position of the object in the third frame (i=3) is still in front of it.
Conversely, the position of the object in the fifth frame (i=5) is slightly behind that in the first frame (i=1), and the position of the object in the sixth frame (i=6) is still behind it.
As for position shifts in the vertical direction, the position of the object in the second frame (i=2) is higher than that in the first frame (i=1), and the position of the object in the fourth frame (i=4) is lower than it.
FIGS. 24A to 24F show an example of an ideal camera work. That is, the position of an object 13a is fixed in position and a background 13b alone moves among frame images.
In this manner, when the position of the object varies among frames, the object is photographed as a blurred image, and a visually preferred video cannot be obtained.
The present invention has been made in consideration of the above-mentioned objects and has as its object to correct the position of an object, which is being tracked by the photographer, to a predetermined position within the frame without producing any vibration upon playback even when a blurred moving image is recorded upon input.
In order to achieve the above object, an image processing apparatus according to the present invention is characterized by comprising the following arrangement.
That is, an image processing apparatus for correcting a position of a specific object included in a moving image formed by a plurality of successive images to a predetermined position on a frame, comprises:
reference point setting means for setting a reference point on the object included in a first image of the plurality of images, which serves as a reference image;
position detection means for detecting positions of corresponding points, which correspond to the reference point, from a plurality of second images, which are different from the first image, of the plurality of images;
shift amount detection means for detecting shift amounts between the corresponding points and the reference point in units of images on the basis of the positions of the corresponding points detected from the plurality of second images, and a position of the reference point; and
corrected image generation means for generating a corrected image of the moving image by correcting positions of the object included in the plurality of second images in correspondence with the shift amounts detected by the shift amount detection means in units of images.
Preferably, the apparatus further comprises display means for displaying the corrected image, which is corrected by the corrected image generation means.
For example, the corrected image generation means includes:
image shift means for shifting the plurality of second images in correspondence with the shift amounts detected by the shift amount detection means in units of images;
maximum shift amount detection means for detecting maximum shift amounts in upper, lower, right, and left directions from the shift amounts produced with respect to original recording regions of the plurality of second images upon shifting the second images by the image shift means; and
predetermined image insertion means for generating the corrected image of the moving image by inserting a predetermined image corresponding to the maximum shift amounts in the upper, lower, right, and left directions detected by the maximum shift amount detection means in the first image and the plurality of second images, which have been shifted by the image shift means.
Also, for example, the corrected image generation means includes:
image shift means for shifting the plurality of second images in correspondence with the shift amounts detected by the shift amount detection means in units of images; and
image synthesis means for selecting images corresponding to missing portions, which have formed with respect to original recording regions of the plurality of second images upon shifting the second images by the image shift means, from the plurality of second images, and synthesizing the selected images as the images of the missing portions.
In order to achieve the above object, an image processing method according to the present invention is characterized by comprising the following arrangement.
That is, an image processing method for correcting a position of a specific object included in a moving image formed by a plurality of successive images to a predetermined position on a frame, comprises:
the reference point setting step of setting a reference point on the object included in a first image of the plurality of images, which serves as a reference image;
the position detection step of detecting positions of corresponding points, which correspond to the reference point, from a plurality of second images, which are different from the first image, of the plurality of images;
the shift amount detection step of detecting shift amounts between the corresponding points and the reference point in units of images on the basis of the positions of the corresponding points detected from the plurality of second images, and a position of the reference point; and
the corrected image generation step of generating a corrected image of the moving image by correcting positions of the object included in the plurality of second images in correspondence with the shift amounts detected in units of images.
Furthermore, a computer-readable storage medium is characterized by implementing the above-mentioned image processing method using, e.g., a computer.
Other features and advantages of the present invention will be apparent from the following description taken in conjunction with the accompanying drawings, in which like reference characters designate the same or similar parts throughout the figures thereof.